<!DOCTYPE html>
<html>
<head>
    <title>getElementById() Example 2</title>
</head>
<body>
    <div id="myDiv">This <code>div</code> should <em>not</em> be retrieved by clicking the button.</div>
    <input type="button" value="Get 'myDiv'" onclick="getDiv()">
    <script type="text/javascript">
        function getDiv(){
            alert(document.getElementById("myDiV"));
        }
    
    </script>
</body>
</html>